In [8]:
import sys
sys.version_info
Out[8]:
In [11]:
import docker
In [12]:
client = docker.from_env()
In [18]:
myimages = client.images.list()
In [19]:
mycontainers = client.containers.list()
In [37]:
from json2html import *
from IPython.display import display, HTML, display_json
#HTML(json2html.convert(json = {'a':'2','b':'3'}))
In [48]:
htcss = """
<style type="text/css">
th { background-color: yellow;}
</style>
"""
for im in myimages:
#client.images.list()
#print(im.attrs)
myhtml = HTML(json2html.convert(json = im.attrs))
myhtml.data = myhtml.data + htcss
#display(HTML(json2html.convert(json = im.attrs)))
display(myhtml)
#print(myhtml.data)
#display_json(json2html.convert(json = im.attrs))
In [6]:
container = client.containers.get('24291d6ec7')
In [7]:
container.attrs['Config']['Image']
Out[7]:
In [8]:
container.logs()
Out[8]:
In [9]:
container.stop()
In [17]:
#if len(client.nodes) > 0: client.nodes.list(filters={'role': 'manager'})
print(client.nodes)
In [ ]: